<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ include file="/WEB-INF/jsps/tag.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改密码</title>
<%@ include file="/WEB-INF/jsps/common_css.jsp"%>
<%@ include file="/WEB-INF/jsps/common_js.jsp"%>
</head>
<body>
	
	<div id="p" class="easyui-panel" title="修改密码"  
        style="padding:100px;background:#fafafa;"   
        data-options="iconCls:'icon-save',fit:true">   
	    
	    <form id="updatePassword_form_id" action="${baseurl}user/updatepassword" method="post">
	    	<table>
	    		<tr>
	    			<td>旧密码</td>
	    			<td><input id="oldPassword" type="password" name="oldPassword"/>  </td>
	    		</tr>
	    		<tr>
	    			<td>新密码</td>
	    			<td><input id="newPassword" type="password" name="newPassword"/>  </td>
	    		</tr>
	    		<tr>
	    			<td>确认新密码</td>
	    			<td><input id="confirmPassword" type="password" name="confirmPassword"/>  </td>
	    		</tr>
	    		<tr>
	    			<td><a id="user_updatepassword_ok" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-ok'">确定</a> </td>
	    			<td><a id="user_updatepassword_cancel" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-reload'">清空</a>  </td>
	    		</tr>
	    	</table>
	    </form>  
	</div> 
</body>

<script type="text/javascript">
		
	$(function(){
		
		//提交表单
		$("#user_updatepassword_ok").click(function(){
			$('#updatePassword_form_id').form('submit', {    
			    url:"${baseurl}user/updatepassword",    
			    onSubmit: function(){  
			    	
			    },    
			    success:function(data){    
			       data = JSON.parse(data);
			    // 消息将显示在顶部中间
			       $.messager.show({
			       	title:'温馨提示',
			       	msg:data.content,
			       	showType:'show',
			       	timeout:2000,
			       	style:{
			       		right:'',
			       		top:document.body.scrollTop+document.documentElement.scrollTop,
			       		bottom:''
			       	}
			       });

			       clearForm();
			    }    
			}); 
		});
		
		
		//取消
		$("#user_updatepassword_cancel").click(function(){
			clearForm();
		});
		
		function clearForm(){
			$("#oldPassword").val("");
			$("#newPassword").val("");
			$("#confirmPassword").val("");
		}
		
	});
	

</script>
</html>